package com.pan.controller;


import com.pan.dao.categoryHistory.CategoryHistoryDao;
import com.pan.entity.OperationCategoryHistory;
import com.pan.entity.Result;
import com.pan.service.CategoryHistoryService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/categoryHistory")
public class CategoryHistoryController {

    @Resource
    private CategoryHistoryService categoryHistoryService;

    @ResponseBody
    @GetMapping("/select/admin/{selectName}/{selectValue}")
    public Result<List<OperationCategoryHistory>> select(@CookieValue("adminTicket")String adminTicket,
                                                         @PathVariable("selectName") String selectName,
                                                         @PathVariable("selectValue") Object selectValue){
        Result<List<OperationCategoryHistory>> result =
                categoryHistoryService.select(adminTicket, selectValue, selectName);
        return result;
    }
}
